<?php
session_start();
require_once(ABSPATH . 'wp-admin/includes/user.php');
require_once(ABSPATH . WPINC . '/registration.php');
require_once dirname( __FILE__ ) . '/form-process.php'; 
?>
<!-- hearder -->
<?php get_header(); ?>
<?php
/*global $wpdb;

$arr_search= array();

//AND pm.meta_key='active' AND pm.meta_value<>'false'
$q_s="SELECT distinct * FROM $wpdb->posts p, $wpdb->postmeta pm ,$wpdb->usermeta um WHERE p.ID=pm.post_id AND p.post_author<>'0' AND p.post_status='publish'  AND  ( ( pm.meta_key like '%".$_POST['s']."%' AND pm.meta_value like '%".$_POST['s']."%' )  OR ( pm.meta_key like '%".str_replace(" ","",$_POST['s'])."%' AND pm.meta_value like '%".str_replace(" ","",$_POST['s'])."%' ) OR ( p.post_title like '%".$_POST['s']."%' ) )  GROUP BY p.ID ORDER BY p.post_date DESC";

$arr_search= $wpdb->get_results( $q_s );	
$have_items=0;
*/
?>
<div id="content">
	<div class="left">
		<!-- search -->            
	       <?php include ('searchform.php'); ?> 
			<div  class="tabcontainer" >				
			<? if (have_posts()){?>
				<? while(have_posts()):?>
    			<? the_post()?>
				
				<div class="question">
        		<div class="question-title">			 
				
            		<div class="question-user-img">
                		<img src="<?php echo get_bloginfo('template_directory'); ?>/images/question-img.jpg" />
                	</div>
                	<div class="question-by">
                		<p><?php the_author_posts_link();?></p>
                    	<p class="question-h1"><a href='<?=the_permalink()?>'><?=the_title()?></a></p>
                	</div>
                			<div style="clear:both;"></div>
				
            	</div>
            <div class="question-bottom">
            	<div class="answer">
                	<a href=<?php comment_link()?>>Answer this question</a>
                	
                </div>
                <div class="answers">                
                	<p><font class="answer-nr"><a href=<?php comment_link();?>><?php comments_number("No Answer", "1 Answer", "% Answers");?> </a></font></p>					
                </div>
                <div class="answer-date">
                	<p><?php the_time(get_option('date_format'));?></p>
                </div>
                <div class="tags">
                	<p>&laquo;&raquo;</p>
                    <ul>
                    	<li><a href="#"><?php if(get_the_tags()) the_tags('', ', ', '');
                    	else echo "None";
                    	?></a></li>                        
                    </ul>
                </div>
			</div>
         </div>			
         
        
    			   	
			<? endwhile; ?>
			
		<? } else { ?>   
			<h3>No Results Is Not Here...</h3>
            <? } ?>
			</div><!-- close tabcontainer  -->
    </div>
	<!-- sidebar -->
	<?php get_sidebar(); ?>
</div>      
<!-- footer -->	    
<?php get_footer(); ?>		


   